﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="detailnews.ascx.cs" Inherits="control_client_detailnews" %>
<div class="blog">
    <asp:DataList ID="list" runat="server" style="margin-right: 575px" Width="100%" 
            DataKeyField="Id" ShowFooter="False" ShowHeader="False" DataSourceID="dsnews">
        <ItemTemplate>
            <div class="leading">
                <h2 class="contentheading">
                    <asp:Label ID="Label1" runat="server" CssClass="contentpagetitle" Text='<%# Eval("TieuDe") %>'></asp:Label>                
	            </h2>
                <p class="iteminfo">
		            <span class="createdby">
		                Đăng bởi <asp:Label ID="author" runat="server" Text='<%# Eval("TenDangNhap") %>' />
		                <asp:Label ID="date" runat="server" Text='<%# Eval("NgayDang", "{0:dd/MM/yyyy}") %>' />
		            </span>
	            </p>
                <div class="introtext">
                    <img src='<%# "images/news/content/" + Eval("HinhAnh") %>' alt="" border="0" height="110" width="170">
                    <p>
                        <asp:Label ID="summary" runat="server" Text='<%# Eval("TomTat") %>'></asp:Label>
                        <br /><br />
                        <asp:Label ID="content" runat="server" Text='<%# Eval("NoiDung") %>'></asp:Label>
                    </p>
                </div>
                <div style="text-align:right; font-style:italic; font-weight:bold;">
                    Nguồn: <asp:Label ID="Label2" runat="server" Text='<%# Eval("NguonTin") %>'></asp:Label>            
                </div>
            <hr>
	        </div>
        </ItemTemplate>
    </asp:DataList>
    <div class="blog_more">		
            <h2>Tin tức cùng chuyên mục</h2>
            <ul>
                <asp:DataList ID="listrnews" runat="server" DataSourceID="dsrnews">
                    <ItemTemplate>
                        <li>
                            <asp:HyperLink ID="rNews" runat="server" 
                                NavigateUrl='<%# "~/detailnews.aspx?key=" + Eval("Id") %>' 
                                Text='<%# Eval("TieuDe") + " (" + Eval("NgayDang", "{0:dd/MM/yyyy}") + ")" %>'></asp:HyperLink>
	                    </li>
                    </ItemTemplate>
                </asp:DataList>                                              
	        </ul>
    </div>
</div>
<asp:SqlDataSource ID="dsnews" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    SelectCommand="SELECT * FROM [TinTuc] WHERE ([Id] = @Id)">
    <SelectParameters>
        <asp:QueryStringParameter Name="Id" QueryStringField="key" Type="Int32" />
    </SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="dsrnews" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    SelectCommand="Relative_News" SelectCommandType="StoredProcedure">
    <SelectParameters>
        <asp:QueryStringParameter Name="Id" QueryStringField="key" Type="Int32" />
    </SelectParameters>
</asp:SqlDataSource>